namespace Digitalmes.Infrastructure.Scada;

/// <summary>
/// 说明文档。
/// </summary>
internal class Doc
{
    /// <summary>
    /// 地址配置示例以及注解。
    /// </summary>
    public const string AddressDemo =
"""
[
  {
    "Name": "Line01", // 生产线编号
    "Keynote": "",
    "Devices": [
      {
        "Name": "01", // 若与区域关联时，可设置为区域编号
        "Model": "S7_1500", "Host": "192.168.0.1", "Port": 0, "MaxPDUSize": 0, "Keynote": "",
        "Tags": [ // 基于设备范围的标记集合，
          { "Name": "PLC_Equipment_Heartbeat", "Address": "DB100.0", "Length": 0, "DataType": "Int", "ScanRate": 500, "Flag": "Heartbeat" },
          { "Name": "PLC_Equipment_Alarm", "Address": "DB100.2", "Length": 96, "DataType": "Bit", "ScanRate": 5000, "Flag": "Notice", "PublishMode": "OnlyDataChanged" },
          { "Name": "PLC_Equipment_State", "Address": "DB100.0", "Length": 0, "DataType": "Int", "ScanRate": 1000, "Flag": "Notice" },
          { "Name": "PLC_Equipment_Mode", "Address": "DB100.0", "Length": 0, "DataType": "Int", "ScanRate": 1000, "Flag": "Notice" },
          { "Name": "PLC_Equipment_Energy", "Address": "DB100.0", "Length": 0, "DataType": "Int", "ScanRate": 600000, "Flag": "Notice", "PublishMode": "EveryScan" }
        ],
        "TagGroups": [ // 分组标记集合，可针对于多个工位
          {
            "Name": "OP010", // 设置为工位编号
            "Tags": [
              { "Name": "PLC_Workstation_State", "Address": "DB1010.0", "Length": 0, "DataType": "Int", "ScanRate": 1000, "Flag": "Notice", "PublishMode": "OnlyDataChanged" },
              {
        		    "Name": "PLC_Inbound_Sign", "Address": "DB1010.0", "Length": 0, "DataType": "Int", "ScanRate": 500, "Flag": "Trigger",
        		    "NormalTags": [
        		      { "Name": "PLC_Inbound_SN", "Address": "DB1010.0", "Length": 50, "DataType": "String" },
        		      { "Name": "PLC_Inbound_ProductCode", "Address": "DB1010.0", "Length": 20, "DataType": "String" },
                  { "Name": "PLC_Inbound_Operator", "Address": "DB1010.0", "Length": 10, "DataType": "String" },
                  { "Name": "PLC_Inbound_Shift", "Address": "DB1010.0", "Length": 10, "DataType": "String" },
        		    ],
        		  },
              {
        		    "Name": "PLC_Outbound_Sign", "Address": "DB1010.0", "Length": 0, "DataType": "Int", "ScanRate": 500, "Flag": "Trigger",
        		    "NormalTags": [
        		      { "Name": "PLC_Outbound_SN", "Address": "DB1010.0", "Length": 50, "DataType": "String" },
        		      { "Name": "PLC_Outbound_PassResult", "Address": "DB1010.0", "Length": 0, "DataType": "Int" },
                  { "Name": "PLC_Outbound_CycleTime", "Address": "DB1010.0", "Length": 0, "DataType": "Int" },
        		    ],
        		  },
              {
        		    "Name": "PLC_StepTask_Sign", "Address": "DB1010.0", "Length": 0, "DataType": "Int", "ScanRate": 500, "Flag": "Trigger",
        		    "NormalTags": [
        		      { "Name": "PLC_StepTask_SN", "Address": "DB1010.0", "Length": 50, "DataType": "String" },
                  { "Name": "PLC_StepTask_Index", "Address": "DB1010.0", "Length": 0, "DataType": "Int" },
                  { "Name": "PLC_StepTask_PassResult", "Address": "DB1010.0", "Length": 0, "DataType": "Int" },
        		      { "Name": "PLC_StepTask_CycleTime", "Address": "DB1010.0", "Length": 0, "DataType": "Int" },
                  { "Name": "PLC_StepTask_Data1", "Address": "DB1010.0", "Length": 0, "DataType": "Int" },
                  { "Name": "PLC_StepTask_Data2", "Address": "DB1010.0", "Length": 0, "DataType": "Int" },
                  { "Name": "PLC_StepTask_Data3", "Address": "DB1010.0", "Length": 0, "DataType": "Real" },
                  { "Name": "PLC_StepTask_Data4", "Address": "DB1010.0", "Length": 0, "DataType": "Real" },
                  { "Name": "PLC_StepTask_Data5", "Address": "DB1010.0", "Length": 0, "DataType": "Real" },
                  { "Name": "PLC_StepTask_Data6", "Address": "DB1010.0", "Length": 0, "DataType": "Real" },
        		    ],
        		  },
              {
        		    "Name": "PLC_ScanKey_Sign", "Address": "DB1010.0", "Length": 0, "DataType": "Int", "ScanRate": 500, "Flag": "Trigger",
        		    "NormalTags": [
        		      { "Name": "PLC_ScanKey_SN", "Address": "DB1010.0", "Length": 50, "DataType": "String" },
        		      { "Name": "PLC_ScanKey_Barcode", "Address": "DB1010.0", "Length": 50, "DataType": "String" },
                  { "Name": "PLC_ScanKey_Step", "Address": "DB1010.0", "Length": 0, "DataType": "Int" },
        		    ],
        		  },
              {
        		    "Name": "PLC_ScanBatch_Sign", "Address": "DB1010.0", "Length": 0, "DataType": "Int", "ScanRate": 1000, "Flag": "Trigger",
        		    "NormalTags": [
        		      { "Name": "PLC_ScanBatch_Barcode", "Address": "DB1010.0", "Length": 50, "DataType": "String" },
        		    ],
        		  },
            ],
            "CallbackTags": [ // 分组（工位）范围回写标记，设置后才可向 PLC 指定地址写入数据
              { "Name": "MES_Callback_Station", "Address": "DB1010.0", "Length": 10, "DataType": "String" },
            ],
          },
        ],
        "CallbackTags": [ // 设备（区域）范围回写标记，设置后才可向 PLC 指定地址写入数据
          { "Name": "MES_Callback_Station", "Address": "DB100.0", "Length": 10, "DataType": "String" },
        ],
      },
    ],
  }
]
""";
}
